<?php 
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');
function getName($colName,$id)
{
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id=".$id;
	$querygetName=mysql_query($sqlgetName);
	$rowgetName=mysql_fetch_row($querygetName);
	return $rowgetName[0];
}
$frm=$_SESSION['form_id'];
$qr="select * from tbl_dtls_q2_main where form_id='$frm'";
$res=mysql_query($qr);
$row=mysql_fetch_array($res);
$dis=$row['district_id'];
$dis_name=getName('district',$dis);
$_SESSION['dis_name']=$dis_name;
$tehsil=$row['tehsil_id'];
$id1=$row['id'];
$_SESSION['id1']=$id1;
$qr1="select census_subdistrict_name from tbl_lookup_location where district_id='$dis' and census_subdistrict_code='$tehsil'";
$res1=mysql_query($qr1);
$row1=mysql_fetch_array($res1);
if(isset($_POST['back']))
{ 
	header('Location: view_village_q2.php');
}	
if(isset($_POST['submit']))
{ 
	//echo $form_id=$_POST['form_id'];
	//echo $_SESSION['form_id']=$form_id;
	header('Location: view_q2_2.php');
}	
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<title>View Q2</title>
</head>
<body>
<div align="center">
<form action="" method="post" enctype="multipart/form-data">
	<table border="0" width="750" id="table1" cellspacing="0" cellpadding="0">
		<tr>
			<td height="30">
			<p align="center">
			<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#000000">
			Questionnaire No.</font><span style="font-weight: 700">
			<font face="Verdana" size="2" color="#000000">2</font></span></td>
		</tr>
		<tr>
			<td height="19">
			<p align="center">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">(For Hand Pump Schemes only)</font></td>
		</tr>
		<tr>
			<td height="18">
				<p align="center">
				<font style="font-size: 8.5pt" face="Arial" color="#000000">Page 1</font></p>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			<font style="font-size: 8.5pt; font-weight: 700" face="Arial">
			Main Location </font></font></td>
		</tr>
		<tr>
			<td height="73">
			<table border="1" width="750" id="table2" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="4">
					<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="157" height="27">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;District</font></td>
					<td width="270"><label id="district"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php $id="$row[district_id]"; echo getName('district',$id);?></font></label></td>
					<td width="111">
					<p align="right">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">Date&nbsp;&nbsp; </font></td>
					<td width="207"><label id="date"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php echo "$row[date]";?></font></label></td>
				</tr>
				<tr>
					<td width="157" height="29">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Block</font></td>
					<td width="270"><label id="block"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php $id="$row[block_id]";echo getName('block',$id);?></font></label></td>
					<td width="111">
					<p align="right">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;Revenue Tehsil&nbsp; </font></td>
					<td width="207"><label id="tehsil"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;<?php  $id="$row[tehsil_id]";echo "$row1[census_subdistrict_name]"?></font></label></td>
				</tr>
		  </table></td></tr>
		<tr>
			<td><span style="font-size: 4pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			</font><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">1. Scheme 
			Details</font></span></td>
		</tr>
		<tr>
			<td>
			<span style="font-size: 3pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table6" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="2">
					<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="270" height="26">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
					Name of the Schemes </font></td>
					<td width="477"><label id="scheme_name"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[scheme_name]";?></font></label></td>
				</tr>
				<tr>
					<td width="270" height="26">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
					Year of Commissioning</font></td>
					<td width="477"><label id="year_comm"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[year_comm]";?></font></label></td>
				</tr>
				<tr>
					<td width="270" height="25">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
					Capital Cost (in <img src="images/26rup1.jpg" width="10"> Lakh)</font></td>
					<td width="477"><label id="capital_cost"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[capital_cost]";?></font></label></td>
				</tr>
				<tr>
					<td width="270" height="26">&nbsp;
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">
					Schemes Sanctioned Under </font></td>
					<td width="477"><label id="scheme_sanction"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[scheme_sanction]";?></font></label></td>
			  </tr>
				</table></td></tr>
		<tr>
			<td>
			<span style="font-size: 5pt">&nbsp;</span></td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			<font style="font-size: 8.5pt; font-weight: 700" face="Arial">
			2.
			Location </font></font></td>
		</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table7" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="4">
					<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="167">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
					Grampanchayat&nbsp;					</font></td>
					<td width="226"><label id="gp"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[panchayat_id]";echo getName('panchayat',$id);?></font></label></td>
					<td width="145">&nbsp;
						<font style="font-size: 8.5pt" face="Verdana" color="#000000">Census Village Code</font></td>
					<td width="207"><label id="census"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[census_vil_code]";?></font></label>					</td>
				</tr>
				<tr>
					<td width="167">&nbsp;
					<font style="font-size: 8.5pt" face="Verdana" color="#000000">
					Village (s) Covered &nbsp;&nbsp;Names</font></td>
					<td width="226"><label id="village"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php $id="$row[village_id]";echo getName('village',$id);?></font></label></td>
					<td width="145"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp;&nbsp;Form ID </font></td>
					<td width="207"><label id="formid"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[form_id]";?></font></label></td>
				</tr>
				
				<tr>
					<td colspan="5" bgcolor="#EEEEEE">&nbsp;
					<font style="font-size: 8.5pt; font-weight: 700" face="Arial" color="#000000">
					Other Habitation covered</font></td>
				</tr>
				</table>			</td>
		</tr>
		<tr>
			<td>
			<table border="1" width="100%" id="table4" cellspacing="1" cellpadding="0" bgcolor="#FDF9EE" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="5"><span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="19%" align="center" bgcolor="#F7E6B7">
					<address>
						<font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Code No. </font>
					</address>
					<address>
					<font face="Verdana" color="#990000" style="font-size: 8pt; font-style: normal">
				  (Census Village/ IMIS)</font></address></td>
					<td align="center" width="23%" bgcolor="#F7E6B7">
					<font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">
					Habitation Name</font></td>
					<td align="center" width="18%" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Type MH/OH</font></td>
					<td align="center" width="20%" bgcolor="#F7E6B7">
					<font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">
					No. of HP's</font></td>
					<td align="center" width="20%" bgcolor="#F7E6B7">
					<address>
						<span style="font-style: normal">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">
				  No. of Single Phase</font></span></address></td>
				</tr>
				<?php
				$qr2="select * from tbl_dtls_q2_habit where q2_id='$id1' order by habit_code asc";
				$res2=mysql_query($qr2);
				while($row2=mysql_fetch_array($res2))
				{
				?>
				 <tr>
				<td width="19%" height="24" align="center"><label id="habit_code"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[habit_code]";?></font></label></td>
				<td width="23%" align="center"><label id="habit_name"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[habit_name]";?></font></label></td>
			   	<td align="center" width="18%"><label id="type_mh_oh"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[type_mh_oh]";?></font></label></td>
				<td width="20%" align="center"><label id="hp_no"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[hp_no]";?></font></label></td>
				<td width="20%" align="center"><label id="sp_no"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[sp_no]";?></font></label></td>
				</tr>
			<?php } ?>
			  </table>
			  </td>
		</tr>
		<tr>
					<td width="745" bgcolor="#EEEEEE">&nbsp;
					<span style="font-weight: 700">
					<font face="Arial" style="font-size: 8.5pt" color="#000000">
					4. Population</font></span></td>
					</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table8" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="5">
					<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="165" align="center">
					 <font face="Verdana" style="font-size: 8.5pt" color="#000000"> 
			        Population Benefited </font><br>
				    <font face="Verdana" style="font-size: 8.5pt" color="#000000"> 
					(as per 2001 census)</font></td>
				  <td width="108"><label id="population_benefited"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[population_benefited]";?></font></label></td>
					<td width="148">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">
				  &nbsp;Present Population&nbsp;&nbsp;&nbsp; </font></td>
				  <td width="324"><label id="present_population"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[present_population]";?></font></label></td>
				</tr>
				</table></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE" height="22"><font color="#000000">&nbsp;
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt">Engineering Aspects</font></span></font></td>
		</tr>
		<tr>
			<td>
			<table border="1" width="750" id="table9" bgcolor="#FDF9EE" cellspacing="1" cellpadding="0" style="border-collapse:collapse; border-color:#99CCCC;">
				<tr>
					<td colspan="4">
					<span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
					<td width="302" height="25">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
					Design Parameters</font></td>
					<td width="443" colspan="3">&nbsp;</td>
				</tr>
				<tr>
					<td width="302" height="25">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
					Population ( As per Design )</font></td>
					<td width="443" colspan="3"><label id="DP_population"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[DP_population]";?></font></label></td>
				</tr>
				<tr>
					<td width="302" height="28">
					&nbsp;
					<font style="font-size: 8.5pt" face="Verdana" color="#000000">
					Water Demand (As per Design ) in KLD</font></td>
					<td width="443" colspan="3"><label id="DP_water_demand"><font face="Verdana" style="font-size: 8.5pt">&nbsp;<?php echo "$row[DP_water_demand]";?></font></label></td>
				</tr>
				<tr>
					<td width="302">&nbsp;</td>
					<td width="443" colspan="3">&nbsp;</td>
				</tr>
				
				</table>			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>
			
			<p align="center">
			<input type="submit" value="Back" name="back" style="font-size: 8pt;font-family:Verdana; border-style: solid; border-width: 1px">&nbsp;&nbsp;
			  <input name="submit" type="submit" id="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px" value="Next" onClick="return validate1()">
		  &nbsp;			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		
		
		</table>
  </form>
</div>
</body>
</html>
